<template>
    <!-- 右上角方法按钮   -->
    <span class="iconfont" 
        :class="{'icon-expand-alt': !isFullScreen, 'icon-compress-alt': isFullScreen}" 
        :style="comStyle"
        @click="toggleFullScreen" ></span>
</template>

<script>
    import ThemeMixins from '@/mixins/ThemeMixins';
    import { getThemeValue } from '@/utils/theme_utils';
    export default {
        name: 'FullScreenIcon',
        mixins: [ThemeMixins],
        props: {
            isFullScreen: {
                required: true,
                type: Boolean
            }
        },
        computed: {
            comStyle() {
                return {
                    color: getThemeValue(this.theme).titleColor,
                }
            }
        },
        methods: {
            toggleFullScreen() {
                this.$emit('toggleFullScreen')
            }
        }
    }
</script>

<style scoped lang='less'>
    .icon-compress-alt,
    .icon-expand-alt {
        color: white;
        cursor: pointer;
        position: absolute;
        top: 20px;
        right: 20px;
    }
</style>